﻿using System;
using System.IO;


namespace Dazaza.Framework.Configuration
{
    public class ConfigurationHelper
    {
        protected static string GetConfigurationFile(string appSection)
        {
            string configFile = System.Configuration.ConfigurationManager.AppSettings[appSection];

            if (File.Exists(configFile))
            {
                return configFile;
            }

            return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile.Replace('/', '\\').TrimStart('\\'));
        }
    }
}
